package com.wxyzz.satserver.comment.controller;

import com.wxyzz.common.core.common.R;
import com.wxyzz.satserver.comment.VO.CommentVO;
import com.wxyzz.satserver.comment.service.CommentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * --- 加油，努力 ---
 *
 * @Author XYP
 * @Date 2024/11/16
 * @Solgne 从想做到能做
 * @Desc
 */
@RestController
@RequestMapping("/comment")
@Api(tags ="评论api")
@CrossOrigin
public class CommentController {

    @Resource
    private CommentService commentService;

    @GetMapping("/articleComments")
    @ApiOperation(value = "文章的评论信息")
    public R articleComments(Integer aid) {
        List<CommentVO> commentVOS = commentService.selectArticleComments(aid);
        return R.ok(commentVOS);
    }

}
